home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d3
/
mcroade2.arc
/
MCOMPILE.DOC
< prev
next >
Wrap
Text File
|
1991-06-23
|
12KB
|
262 lines
MCompile.exe
A Utility for Compiling ASCII Text File
Listings of WordPerfect 5.1 Macros
into Executable Macro (.wpm) Files
by
Jeffrey S. Kane, Ph.D.
Performance Sciences International
Summerfield, NC
1. Read the MacroAde.doc and Disclaim.er files distributed with this
utility.
2. Requires:
A. WordPerfect 5.1 (for use of compiled macros)
B. MS/PC-DOS 3.0 or higher
C. An ASCII source file that conforms to the compiler's
structure and syntax specifications.
3. Features:
A. Fast (e.g., less than 4 seconds for a 10K source file
on 386DX-20 machine).
B. Compact .exe file size (9193 bytes)
C. Accurate
D. Powerful: accepts source files of unlimited size.
E. Handles either spaces or tabs as formatting characters
at the beginnings of lines (up to first significant
character on any line).
4. Installation:
No installation is required other than to copy the
MCompile.exe file to the directory where your WordPerfect
macros reside. As in the case of Macrolst, we recommend
locating MCompile in this directory for the sake of
convenience, there being no inherent technical requirement to
do so.
5. Operation:
A. Structure of Source Files
ASCII text file listings of macros, which we'll
refer to as source files from this point onward, must
conform to an easily achieved structure in order to be
successfully compiled. The structure of a source file
consists of three separate components, as follows:
1) Header: all characters from the start of the file
to the 'STARTMACRO:' code delimiter.
2) Code Delimiter: the word 'STARTMACRO:', including
its terminating colon.
3) Source Code: all characters from the end of the
code delimiter to the end of the file.
The compiler will first search through the Header to
find the phrase,
Macro Description:
All the characters up to a maximum of 39 that occur between
the colon at the end of the above phrase and the first end of
line sequence (ASCII 13ASCII 10, produced by pressing your
[ENTER] key) encountered before the beginning of the
'STARTMACRO:' code delimiter will be used as the macro
description. Thus, if you intend there to be no description
for the macro, either leave out the 'Macro Description:'
phrase altogether, or follow it with an immediate press of
your [ENTER] key.
The compiler then looks for the 'STARTMACRO:' code
delimiter. This delimiter MUST appear before the start
of the source code, or no compilation will occur. Every
character after the code delimiter to the end of the
source file will be compiled into macro code.
To generate an example of how the structure of a
source file should look, use the Macrolst program to
create a source file from one of your existing macros.
Macrolst creates files which are directly recompilable
back to macros (i.e., .wpm files).
B. Syntax of Source Files
1) All macro and keystroke commands must begin with an
opening French brace ({) and end with a closing
French brace (}).
2) In earlier versions of MacroAde the MCompile program
required that the case (i.e., upper or lower) of every
letter between the braces in all macro and keystroke
commands exactly match that used in the display format
of the commands. However, several macro enthusiasts
have suggested that the goal of any external editing
capability is ease of use. To have to observe the
proper case of command characters conflicts with that
goal. Consequently, in this version any mix of cases
may be used in entering any command. However, MacroLst
will continue to translate the commands in a macro in
accordance with WordPerfect's case format conventions.
in WordPerfect.
3) Most of the macro commands are listed and explained in
detail in Appendix K of the WordPerfect 5.1 manual.
The complete list of the commands is presentedd for
syntax reference purposes in the COMMANDS.ref file
contained in the MacroAde package.
4) WordPerfect furnishes no list of the keystroke commands
in the form in which they actually appear in WordPerfect's
macro editor. MacroAde provides the needed list of these
commands in their correct form in its COMMANDS.ref file,
following the list of macro commands. Next to each
keystroke command its WordPerfect code is listed,
which is needed for some macro commands. These
commands must be entered exactly as they appear in
this list EXCEPT for their case or a syntax error will
occur and halt compilation.
5) One special syntax rule that is unique to creating
source files compilable by MCompile concerns the
manner in which non-keyboard characters are entered
to correspond to the use of WordPerfect's 'Compose'
feature. This feature is used to access characters
in WordPerfect character sets above Set 0 (i.e.,
Sets 1-12), although it can also be used for Set 0
if there is some reason to do so (e.g., see below for
the special case of specifying braces as literal
characters, not parts of commands). You can specify
any of these characters in the 13 Character Sets
(see Appendix P of WordPerfect manual) by entering
its code using the following syntax:
[:S,C]
where:
S = the WordPerfect Character Set number (0-
12)
C = the number of the character within the
specified Character Set
For example, to specify the copyright symbol, which
is character 23 in set 4, you could enter:
[:4,23]
NOTE: Even though the compiler accepts certain high
ASCII codes in the above form (e.g., [:0,250]) for
various purposes in the construction of .wpm files,
do not use any other high ASCII characters (i.e., >126)
in your macro if they aren't specifically allowed in
these instructions. WordPerfect's character set 0 only
contains the first 126 ASCII characters; use of others
not authorized here will not be recognized in WordPerfect.
6) Tabs and spaces may be used at the beginning of
each line to indent it for formatting purposes.
The compiler interprets all tab (ASCII 9), and
space (ASCII 32) characters that occur before any
other characters at the beginning of a line as
formatting characters and translates them all to
tabs. If you need to continue a line containing a
sequence of literal spaces (i.e., spaces that actually
need to be in the macro) in such a manner that would
cause one of the literal spaces to start the next line,
represent that first space by ASCII 250 (or [:0,250] if
your editor won't allow entry of the high ASCII
characters.)
7) After the first non-formatting character on each line
use only tabs, not spaces, to do all spacing for purely
formatting purposes to make the source code easier to
read. The use of spaces for this purpose after the
first non-formatting character in a line will result
in the macro actually entering those spaces in the
document in which the macro is executed.
8) Ensure that the editor you use to create or modify
the source file does not replace tabs with spaces
when its saves the file. Many editors provide
configuration options to control this. For
example, with QEDIT you must set the configuration
for tabs (i.e., by executing QCONFIG and selecting
'Tab Settings' from the menu) to start in Physical
Tab Expansion Mode and in Tabs Out Mode. These are
the first two questions asked in the Tab Setting
configuration process. You should also answer 'No'
to the last question in this part of the
configuration process--'Do you want to start in
Smart Tabs Mode?'.
9) If you want to visibly mark spaces (e.g., for ease
of counting), use ASCII character 250 (FA Hex) or
[:0,250] if your editor doesn't allow entry of high
ASCII characters. This character will be properly
compiled as a space character (ASCII 32).
10) Do NOT use the "{" and "}" characters in any way other
than to enclose a macro or keystroke command within the
macro source code. The compiler assumes that all
occurrences of these characters are meant to enclose
commands and will generate an error and terminate
compilation if they occur without enclosing commands.
This is the only difference from WordPerfect's internal
macro editor, which allows you to use these French braces
as characters having nothing to do with commands.
You can, however, enter non-command related braces
in character code form. Specifically, you can insert
literal braces anywhere in a macro by using the following
codes:
"{" = [:0,123]
"}" = [:0,125]
11) A violation of any of these syntax rules or the
occurrence of an illegal or misspelled command will
cause MCompile to issue an error message and halt
execution. It also assigns a value from 11 to 17
to the DOS Errorlevel variable to designate the
occurrence of a particular error. Checking
Errorlevel is a useful way of checking the
compilation process when MCompile is executed
within a batch file.
C. Once a source file is ready for compiling, the actual
compilation process is invoked by the following command:
MCompile macro(.lst)
Note that the name of the source file on the MCompile
command line may exclude the .lst extension, but will
accept the name with this extension if it is given.
MCompile assumes that any source file has the .lst
extension, but this assumption may be overridden by
explicitly specifying a different extension.
D. If for some reason the compilation fails and a macro of
that name previously existed, the prior version of the
macro will be preserved.
6. Technical support:
Free technical support will be furnished to any licensed user
who calls on weekdays during the hours from 9:00 a.m. to 5:00 p.m.
(Eastern) at the following number: (919) 643-3492
We may also be reached by mail at:
Performance Sciences International
Suite 1250
3001 Latta Drive
Summerfield, NC 27358